﻿@model  IEnumerable<MVC01.Models.Top3Product>
@{
    ViewBag.Title = "Home Page";
}
<div class="products">
    <div class="cl">
        &nbsp;</div>
    <ul>
        @{
            int i = 1;
            foreach (var item in Model)
            {
                foreach (var product in item.Product)
                {
                    string clsBreak = (i % 3) == 0 ? "break" : "";
                    string imgPath = product.MainImage;
                    imgPath = @Url.Content("~/Content/images/" + imgPath);
            <li class='@clsBreak'><a class="openDialog" href="@Url.Action("ProductDetail", "Home", new { pid = product.ProductId, cid = item.CategoryId })" data-dialog-title="Chi tiết sản phẩm"
                    data-dialog-id="aboutlDialog">
                <img src='@imgPath' alt="" height="383px" width="231px" /></a>
                <div class="product-info">
                    <h3>
                        @product.Name
                    </h3>
                    <div class="product-desc">
                        <h4>
                            @item.CategoryName
                        </h4>
                        <p>
                            @product.Description</p>
                        <strong class="price">@string.Format("{0:0,0}", product.Price)
                            VNĐ</strong>
                    </div>
                </div>
            </li>
                    i++;
                }

            }
        }
    </ul>
    <div class="cl">
        &nbsp;</div>
</div>
